package com.thejaswi.commons;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author raj
 */
// Custom exception class that descends from Java's Exception class.
public class CustomException extends Exception {
  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	String customExceptionMessage;

	// Default constructor - initializes instance variable to unknown
	public CustomException() {
		super();             // call superclass constructor
    	customExceptionMessage = "unknown";
	}

// Constructor receives some kind of message that is saved in an instance variable.
  public CustomException(String errMessage) {
    super(errMessage);     // call super class constructor
    customExceptionMessage = errMessage;  // save message
  }

// public method, callable by exception catcher. It returns the error message.
  public String getError() {
    return this.customExceptionMessage;
  }

}
